// src/renderer/src/main.js
import { createApp } from 'vue';
import { createVuetify } from 'vuetify';
import * as components from 'vuetify/components';
import * as directives from 'vuetify/directives';
import axios from 'axios';
import App from './App.vue';
import router from './router';
import store from './store';


// 初始化Electron集成
if (!import.meta.env.DEV) {
  const { contextBridge } = require('electron')
  contextBridge.exposeInMainWorld('electron', {
    require: require,
    process: process
  })
}

// 配置Vuetify 3
const vuetify = createVuetify({
  components,
  directives,
  theme: {
    defaultTheme: 'dark'
  }
})

// 创建Vue应用实例
const app = createApp(App)

// 全局配置
app.config.globalProperties.$http = axios

// 注册插件
app.use(vuetify)
app.use(router)
app.use(store)
// 挂载应用
app.mount('#app')

// 开发工具集成
// if (import.meta.env.DEV) {
//   import('vue-devtools').then(({ connect }) => connect('localhost', 9090))
// }